<?php
/**
 * Firal CMS
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.opensource.org/licenses/bsd-license.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to firal-dev@googlegroups.com so we can send you a copy immediately.
 *
 * @category   Firal
 * @package    Firal_Models
 * @subpackage Base
 * @copyright  Copyright (c) 2008 MaakSite.nl Productions. (http://productions.maaksite.nl/)
 * @license    http://www.opensource.org/licenses/bsd-license.php     New BSD License
 * @version    $Id: BaseFiralReply.php 11 2008-06-30 16:14:44Z pieterkokx $
 */


/**
 * Base class for replies
 *
 * @category   Firal
 * @package    Firal_Models
 * @subpackage Base
 * @copyright  Copyright (c) 2008 MaakSite.nl Productions. (http://productions.maaksite.nl/)
 * @license    http://www.opensource.org/licenses/bsd-license.php     New BSD License
 */
abstract class BaseFiralReply extends Doctrine_Record
{
    
    public function setTableDefinition()
    {
        $this->setTableName('firal_replies');
        
        $this->hasColumn('author_id', 'integer', 20, array('notnull' => true));
        $this->hasColumn('external_id', 'integer', 20, array('notnull' => true));
        $this->hasColumn('content', 'clob', 2147483647, array('notnull' => true));
        $this->hasColumn('type', 'integer', 11, array('notnull' => true));
        
        $this->setSubclasses(array(
            'FiralPageReply'  => array('type' => 1)
        ));
    }
    
    public function setUp()
    {
        parent::setUp();
        
        $this->hasOne('AuthUser as User', array(
            'local'   => 'author_id',
            'foreign' => 'id'
        ));
    }

}